﻿using System.Collections.Generic;
using System.Threading.Tasks;
using BCEntity.TMS.Driver.DriverExamine;

namespace BCData.TMS.Driver.DriverExamine
{
    /// <summary>
    /// 司机考试试题
    /// </summary>
    public interface IDriverExamineTestQuestionData
    {
        /// <summary>
        /// 新增司机考试试题
        /// </summary>
        /// <param name="entity">司机考试试题</param>
        /// <returns></returns>
        Task<DriverExamineTestQuestionEntity> InsertAsync(DriverExamineTestQuestionEntity entity);
        /// <summary>
        /// 根据试卷Id获取司机考试试题
        /// </summary>
        /// <param name="paperId">试卷Id</param>
        /// <returns></returns>

        Task<IEnumerable<DriverExamineTestQuestionEntity>> GetDriverExamineTestQuestionsByPaperId(long? paperId);
        /// <summary>
        /// 获取考试试题正确答案数
        /// </summary>
        /// <param name="datumIds">学习资料Id列表</param>
        /// <returns></returns>
        Task<int> GetDatumCorrectAnswers(int[] datumIds);
        /// <summary>
        /// 获取考试试题错误答案数
        /// </summary>
        /// <param name="datumIds">学习资料Id列表</param>
        /// <returns></returns>
        Task<int> GetDatumErrorAnswers(int[] datumIds);
        /// <summary>
        /// 根据试题编号和试卷Id检查是否存在
        /// </summary>
        /// <param name="testQuestionNo">试题编号</param>
        /// <param name="paperId">试卷Id</param>
        /// <returns></returns>
        Task<bool> CheckExistsByQuestionsNoAndPaperId(string testQuestionNo, long paperId);
        /// <summary>
        /// 根据学习资料获取考试试题
        /// </summary>
        /// <param name="datumId">学习资料Id</param>
        /// <returns></returns>
        Task<IEnumerable<DriverExamineTestQuestionEntity>> GetDriverExamineTestQuestionsByDatumId(long? datumId);
        /// <summary>
        /// 批量删除考试试题
        /// </summary>
        /// <param name="datumIds">学习资料Id</param>
        /// <returns></returns>

        Task<int> DeleteByDatumIds(int[] datumIds);
    }
}
